﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="VisitView.aspx.cs" Inherits="mal.balades.Web.Views.VisitView" %>

<%@ Register Src="../Controls/GoogleAdSense.ascx" TagName="GoogleAdSense" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="/Styles/VisitView.css" rel="stylesheet" type="text/css" />
    <meta name="Description" id="metaDescription" runat="server" />
    <script>
        <%=BuildJavascript() %>      
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="visitLeft">
        <h1 id="h1Title" runat="server">
            <%=visit.Title%>
        </h1>
        <div id="visitInformations">
            <asp:Panel ID="visitCoordinates" CssClass="visitInformation" runat="server">
                <span class="pictoGps">gps</span>
                <asp:Literal ID="coordonates" runat="server" />
            </asp:Panel>
            <!-- AddThis Button BEGIN -->
            <div class="visitInformation" style="width: 200px">
                <span class="pictoShare">partager</span>
                <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style ">
                    <a class="addthis_button_preferred_1" /><a class="addthis_button_preferred_5" />
                    <a class="addthis_button_preferred_4" /><a class="addthis_button_preferred_6" />
                    <a class="addthis_button_preferred_7" /><a class="addthis_button_compact"></a>
                </div>
                <script type="text/javascript">                    var addthis_config = { "data_track_clickback": true };</script>
                <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=malbaladejo"></script>
                <!-- AddThis Button END -->
            </div>
            <!-- AddThis Button END -->
            <div class="visitInformation">
                <span class="pictoCategories">catégories</span>
                <asp:HyperLink ID="placeCat" runat="server" />
                ,
                <asp:HyperLink ID="marketCat" runat="server" />
            </div>
            <div style="clear: both">
            </div>
        </div>
        <div id="visitTabs">
            <asp:PlaceHolder ID="visitTab" runat="server"><a class='visitTabOn' data-bind="click: function(){viewModel.ShowTab('VisitText')}, css:{visitTabOn : IsVisitTextVisible,  visitTabOff : IsVisitTextVisible()==false}">
                La visite</a> </asp:PlaceHolder>
            <asp:PlaceHolder ID="picturesTab" runat="server"><a class='visitTabOn' data-bind="click: function(){viewModel.ShowTab('Pictures')}, css:{visitTabOn : IsPicturesVisible,  visitTabOff : IsPicturesVisible()==false}">
                Photos</a> </asp:PlaceHolder>
            <asp:PlaceHolder ID="feedTab" runat="server"><a class='visitTabOff' data-bind="click: function(){viewModel.ShowTab('Feeds')}, css:{visitTabOn : IsFeedsVisible,  visitTabOff : IsFeedsVisible()==false}">
                Actualités</a> </asp:PlaceHolder>
            <asp:PlaceHolder ID="closedVisitsTab" runat="server"><a class='visitTabOff' data-bind="click: function(){viewModel.ShowTab('ClosedVisits')}, css:{visitTabOn : IsClosedVisitsVisible,  visitTabOff : IsClosedVisitsVisible()==false}">
                A proximité</a> </asp:PlaceHolder>
            <div style="clear: both">
            </div>
        </div>
        <div id="VisitText" class="visitBloc" data-bind="visible: IsVisitTextVisible">
            <asp:Image ID="headerImage" runat="server" CssClass="visitHeaderImage" />
            <%=FormatText(visit.Text)%>
            <h2>
                Les plus :</h2>
            <asp:Repeater ID="advantages" runat="server">
                <ItemTemplate>
                    <asp:Literal ID="advantage" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Text") %>' />
                    <br />
                </ItemTemplate>
            </asp:Repeater>
            <h2>
                Les moins :</h2>
            <asp:Repeater ID="inconveniences" runat="server">
                <ItemTemplate>
                    <asp:Literal ID="advantage" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Text") %>' /><br />
                </ItemTemplate>
            </asp:Repeater>
            <h2 id="H3" runat="server">
                Nos conseils :</h2>
            <asp:Repeater ID="advices" runat="server">
                <ItemTemplate>
                    <asp:Literal ID="advantage" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Text") %>' />
                    <br />
                </ItemTemplate>
            </asp:Repeater>
        </div>
        <div id="pictures" class="visitBloc" data-bind="visible: IsPicturesVisible">
            <h2 id="H1" runat="server">
                Les photos :</h2>
            <script id="visitPicturesTemplate" type="text/html">  
            
               <div class='visitPicturePanel' data-bind=" attr:{id: Id}">         
                    <img  data-bind="attr: {src: Url}" class='visitPicture' />                        
                    <h3 data-bind="text: Title" />
                </div>  
            </script>
            <script id="visitPicturePagesTemplate" type="text/html">  
               <a data-bind="click: select,text: Number,css:{PageNumberSelected : IsSelected,  PageNumber : IsSelected()==false}" </a>
            </script>
            <div data-bind="template: {name:'visitPicturesTemplate', foreach:Pictures}">
            </div>
            <div id="picturePages" data-bind="template: {name:'visitPicturePagesTemplate', foreach:Pictures}">
            </div>
        </div>
        <asp:PlaceHolder ID="feedsPanel" runat="server">
            <div id="Feeds" class="visitBloc" data-bind="visible: IsFeedsVisible" style="display: none">
                <asp:Repeater ID="rptFeeds" runat="server">
                    <ItemTemplate>
                        <asp:Repeater ID="rptFeed" runat="server" DataSource='<%#DataBinder.Eval(Container.DataItem, "Items") %>'>
                            <ItemTemplate>
                                <div style="margin-bottom: 10px">
                                    <h2>
                                        <a href='<%#DataBinder.Eval(Container.DataItem, "Url") %>' target="_blank">
                                            <%#DataBinder.Eval(Container.DataItem, "Title")  %>
                                        </a>
                                    </h2>
                                    <%#DataBinder.Eval(Container.DataItem, "Summary")  %>
                                </div>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
        </asp:PlaceHolder>
        <div class="visitBloc" id="ClosedVisits" data-bind="visible: IsClosedVisitsVisible"
            style="display: none">
            <h2 id="H2" runat="server">
                Autres visites dans un rayon de 20 kilomètres :</h2>
            <div style="display: none">
                <asp:Repeater ID="rptClosedVists" runat="server">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#VisitUrl(DataBinder.Eval(Container.DataItem, "Url")) %>'>
                            <%#DataBinder.Eval(Container.DataItem, "Title")%>
                        </asp:HyperLink>
                        <span style="font-size: 12px">(<%#System.Math.Round((double)DataBinder.Eval(Container.DataItem, "Distance"),1)%>kms)
                        </span></h2>
                        <%#DataBinder.Eval(Container.DataItem, "SumUp")%>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <script id="closedVisitsTemplate" type="text/html">    
                <tr valign="top">
                    <td>
                        <img data-bind="attr: { src: FullPictureUrl}" class="visitThumbnail"  />
                    </td>
                    <td>
                    <h2>
                        <a data-bind="text: Title, attr: { href: FullUrl}"  />
                        <span style="font-size:12px">(<span data-bind="text: Distance" /> kms)
                        </span>
                        </h2>
                      
                        <span data-bind="text: SumUp" /> 
                    </td>                   
                </tr>
            </script>
            <div data-bind="visible: IsClosedVisitsLoaded()==false">
                Chargement ...
            </div>
            <table border="0" data-bind="visible: IsClosedVisitsLoaded()">
                <tbody data-bind="template: {name:'closedVisitsTemplate', foreach:ClosedVisits}">
                </tbody>
            </table>
        </div>
        <uc1:GoogleAdSense ID="GoogleAdSense2" Block="Rectangle" runat="server" />
    </div>
    <div id="visitRight">
        <div id="visitMap" class="visitBloc">
            <div id="VisitBingMap">
                <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
                    width="100%" height="100%">
                    <param name="source" value="/ClientBin/mal.balades.Map.xap" />
                    <param name="onError" value="onSilverlightError" />
                    <param name="background" value="white" />
                    <param name="minRuntimeVersion" value="4.0.50401.0" />
                    <param name="autoUpgrade" value="true" />
                    <param name="InitParams" value="visitUrlName=<%=VisitUrlName %>" />
                    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
                        <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
                            style="border-style: none" />
                    </a>
                </object>
                <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
                    border: 0px"></iframe>
            </div>
        </div>
        <div class="visitAd">
            <uc1:GoogleAdSense ID="GoogleAdSense1" Block="Small" runat="server" Visible='true' />
        </div>
        <div id="visitThumbnails">
            <script id="visitThumbnailsTemplate" type="text/html">  
               <img  data-bind="click: select,attr: {src: Url, title:Title}" class="visitThumbnail" />                       
                     
            </script>
            <div data-bind="template: {name:'visitThumbnailsTemplate', foreach:Pictures}">
            </div>
        </div>
        <div class="visitAd">
            <uc1:GoogleAdSense ID="GoogleAdSense3" Block="Small" runat="server" />
        </div>
    </div>
    <div style="clear: both">
    </div>
</asp:Content>
<asp:Content ID="bottom" ContentPlaceHolderID="BottomContent" runat="server">
</asp:Content>
